<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
   <table class="${tableclass}" style="width: 100%">
	   <tr><th>
	          <strong class="am-text-primary am-text-lg">项目管理</strong> /  目标列表 - ${project.name}
	    	</th>
	    </tr>
	</table>
  <div style="margin-left: 0.5rem">
    <div class="seller_list_title">
        <ul class="seller_title_ul am-tabs-nav am-nav am-nav-tabs">
            <li><i></i><a href="<ls:url address="/admin/project/load/${project.id}"/>">项目信息</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectPlan/query/${project.id}"/>">里程碑</a></li>
            <li class="am-active"><i></i><a href="<ls:url address="/admin/task/query/${project.id}"/>">目标</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectModule/query/${project.id}"/>">模块</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectMember/query/${project.id}"/>">团队</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectReport/query/${project.id}"/>">报表</a></li>
        </ul>
    </div>
</div>  

    <form action="<ls:url address='/admin/task/query'/>" id="form1" method="post">
        <table class="${tableclass}" style="width: 100%">
		    <tbody><tr><td>
		    	    <div align="left" style="padding: 3px">
				       	    <input type="hidden" id="curPageNO" name="curPageNO" value="${curPageNO}" />
				        	<auth:auth ifAnyGranted="F_VIEW_ALL_DATA">
				            	&nbsp;商城名称
				            	<input type="text" name="userName" maxlength="50" value="${task.userName}" />
				            </auth:auth>
				            <input type="submit" value="搜索"/>
				            <input type="button" value="创建" onclick='window.location="<ls:url address='/admin/task/loadByProject/${project.id}'/>"'/>
				      </div>
		     </td></tr></tbody>
	    </table>
    </form>
        <div align="center">
          <%@ include file="/WEB-INF/pages/common/messages.jsp"%>
		<display:table name="list" requestURI="/admin/task/query" id="item" export="false" sort="external" class="${tableclass}" style="width:100%">
     		<display:column title="目标名称" property="name"></display:column>
     	    <display:column title="目标进度" property="rate"></display:column>
     		<display:column title="截止日期" property="deadline"></display:column>
     		<display:column title="指派给" property="assignedtoRealName"></display:column>
     		<display:column title="完成者" property="finishedby"></display:column>
     		<display:column title="状态" property="status"></display:column>
	   		<display:column title="操作" media="html">
		      	<div class="am-btn-toolbar">
			      <div class="am-btn-group am-btn-group-xs">
				     <button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="window.location.href='${contextPath}/admin/task/load/${item.id}'"><span class="am-icon-search"></span>查看</button>
					 <div class="am-dropdown" data-am-dropdown>
		                <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle><span class="am-icon-cog"></span> <span class="am-icon-caret-down"></span></button>
		                <ul class="am-dropdown-content">
		                  <li><a href="${contextPath}/admin/member/user/roles/">1. 查看用户角色</a></li>
		                  <li><a href="${contextPath}/admin/member/user/functions/">2. 查看用户权限</a></li>
		                 </ul>
	              </div>
              		<button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick="javascript:deleteById('${item.id}')"><span class="am-icon-trash-o"></span> 删除</button>
				 </div>
			 	</div>
		      
		      
	       </display:column>
	    </display:table>
	    <ls:page pageSize="${pageSize }"  total="${total}" curPageNO="${curPageNO }"  type="default"/> 
	    </div>

        <script language="JavaScript" type="text/javascript">
			  function deleteById(id) {
			      if(confirm("  确定删除 ?")){
			            window.location = "<ls:url address='/admin/task/delete/" + id + "'/>";
			        }
			    }
			
			        function pager(curPageNO){
			            document.getElementById("curPageNO").value=curPageNO;
			            document.getElementById("form1").submit();
			        }
		</script>

